package com.xmut.mall.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xmut.mall.member.entity.MemberCouponRelationEntity;
import com.xmut.mall.member.utils.RespBean;
import com.xmut.mall.member.vo.MemberCouponVo;

import java.util.Map;

public interface MemberCouponRelationService extends IService<MemberCouponRelationEntity> {
    /**
     * 用户领取优惠券
     * @param memberId
     * @param couponId
     * @return
     */
    RespBean receiveCoupon(Long memberId, Long couponId);

    /**
     * 获取用户的优惠券(分页)
     * @param params
     * @return
     */
    MemberCouponVo getUserCouponByPage(Map<String, Object> params);

    /**
     * 查询用户领取了几次当前id的优惠券
     * @param couponId
     * @param userId
     * @return
     */
    RespBean getUserReceiveCouponNum(Long couponId, Long userId);

    /**
     * 用户领取优惠券
     * @param params
     * @return
     */
    RespBean userReceiveCoupon(Map<String, Object> params);

}
